﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Fractalz.MainWindow;
using Fractalz.FractalWindows;

namespace Fractalz
{
    public partial class MainForm : Form
    {
        // List of all open windows
        List<IFractalWindow> openWindows;
        IFractalWindow activeWindow;
        FractalStatus fs;

        public MainForm()
        {
            InitializeComponent();
            //this.WindowState = Properties.Settings.Default.MainFormMaximizedState;
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
			openWindows = new List<IFractalWindow>();            
        }

		private void juliaToolStripMenuItem_Click(object sender, EventArgs e)
		{
			IFractalWindow newWindow = new Julia();
			newWindow.setMDIParent(this);
			newWindow.getHandle().Text = "Julia " + openWindows.Count;
			newWindow.getHandle().Show();
			newWindow.render();
			openWindows.Add(newWindow);
			activeWindow = newWindow;
		}

		private void mandelbrotToolStripMenuItem_Click(object sender, EventArgs e)
		{
			IFractalWindow newWindow = new Mandelbrot();
			newWindow.setMDIParent(this);
			newWindow.getHandle().Text = "Mandelbrot " + openWindows.Count;
			newWindow.getHandle().Show();
			newWindow.render();
			openWindows.Add(newWindow);
			activeWindow = newWindow;
		}

		private void iFSToolStripMenuItem_Click(object sender, EventArgs e)
		{
			IFractalWindow newWindow = new IFS();
			newWindow.setMDIParent(this);
			newWindow.getHandle().Text = "IFS " + openWindows.Count;
			newWindow.getHandle().Show();
			newWindow.render();
			openWindows.Add(newWindow);
			activeWindow = newWindow;

		}
    }
}
